package com.hanhai.material.model.machine;

import com.hanhai.material.device.entity.SysProductRecord;
import com.hanhai.material.device.entity.SysWorkPlan;
import com.hanhai.material.model.workplan.WorkPlan;
import com.mybatisflex.annotation.RelationOneToMany;
import com.mybatisflex.annotation.RelationOneToOne;
import lombok.Data;

import javax.crypto.Mac;
import java.util.List;

@Data
public class MachineModel {
    private String id;
    private String name;
    private String label;
    private Integer extra;

    private List<MachineModel> children;
//    @RelationOneToMany(selfField = "name",targetField = "machineName",extraCondition = "product_date= :productDate and actual_start_time is not null and actual_end_time is null")
    @RelationOneToMany(selfField = "name",targetField = "machineName",extraCondition = "actual_start_time is not null and actual_end_time is null and (work_shop='成型车间' or work_shop='' or work_shop is null) order by work_plan_id",dataSource = "device")
    private List<SysProductRecord> productRecordList;

    private SysProductRecord productRecord;
}
